package com.projects.android.dto;

import java.util.ArrayList;

import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;

public class FoodTypeDTO {
	private int ID;
	private String Name;
	private ArrayList<RestaurantDTO> Restaurants;
	
	public String toString(){
		return Name;
	}
	
	public void initObject(JSONObject data) {
		try {
			ID = Integer.valueOf(data.getString("ID"));
			Name = data.getString("Name");
			Restaurants = new ArrayList<RestaurantDTO>();
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			Log.e("Init FoodTypeDTO", e.toString());
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			Log.e("Init FoodTypeDTO", e.toString());
		}
	}
	
	public int getID() {
		return ID;
	}
	public void setID(int iD) {
		ID = iD;
	}
	public String getName() {
		return Name;
	}
	public void setName(String name) {
		Name = name;
	}
	public ArrayList<RestaurantDTO> getRestaurants() {
		return Restaurants;
	}
	public void setRestaurants(ArrayList<RestaurantDTO> restaurants) {
		Restaurants = restaurants;
	} 	
}
